<?php
/**
 * $string  要处理的字符串
 * $length  要截取的长度，默认是10
 * $etc     在最后变补充的默认...
 */
function smarty_modifier_truncate_d($string, $length = 10, $etc = '...')
{
	if(mb_strlen($string,"utf8")>$length)
	{
		return mb_substr($string,0,$length,"utf8") . $etc;
	}else{
		return mb_substr($string,0,$length,"utf8");
	}
	
}








/* vim: set expandtab: */

?>
